package pub.model;

import javax.persistence.Column;
import javax.persistence.Embeddable;

/**
 * CompanyprovinceId entity. @author MyEclipse Persistence Tools
 */
@Embeddable
public class CompanyprovinceId implements java.io.Serializable {

	// Fields

	private Integer company;
	private Integer province;

	// Constructors

	/** default constructor */
	public CompanyprovinceId() {
	}

	/** full constructor */
	public CompanyprovinceId(Integer company, Integer province) {
		this.company = company;
		this.province = province;
	}

	// Property accessors

	@Column(name = "company", nullable = false)
	public Integer getCompany() {
		return this.company;
	}

	public void setCompany(Integer company) {
		this.company = company;
	}

	@Column(name = "province", nullable = false)
	public Integer getProvince() {
		return this.province;
	}

	public void setProvince(Integer province) {
		this.province = province;
	}

	public boolean equals(Object other) {
		if ((this == other))
			return true;
		if ((other == null))
			return false;
		if (!(other instanceof CompanyprovinceId))
			return false;
		CompanyprovinceId castOther = (CompanyprovinceId) other;

		return ((this.getCompany() == castOther.getCompany()) || (this.getCompany() != null && castOther.getCompany() != null && this
				.getCompany().equals(castOther.getCompany())))
				&& ((this.getProvince() == castOther.getProvince()) || (this.getProvince() != null && castOther.getProvince() != null && this
						.getProvince().equals(castOther.getProvince())));
	}

	public int hashCode() {
		int result = 17;

		result = 37 * result + (getCompany() == null ? 0 : this.getCompany().hashCode());
		result = 37 * result + (getProvince() == null ? 0 : this.getProvince().hashCode());
		return result;
	}

}